home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-02 / fgl110c.zip / 11-03.C < prev    next >
Text File  |  1992-01-31  |  718b  |  37 lines

  1. #include <fastgraf.h>
  2. #include <stdio.h>
  3. #include <stdlib.h>
  4.  
  5. void main(void);
  6.  
  7. void main()
  8. {
  9.    int new_mode, old_mode;
  10.  
  11.    new_mode = fg_bestmode(320,200,1);
  12.    if (new_mode < 0 || new_mode == 12) {
  13.       printf("This program requires a 320 ");
  14.       printf("x 200 color graphics mode.\n");
  15.       exit(1);
  16.       }
  17.    old_mode = fg_getmode();
  18.    fg_setmode(new_mode);
  19.  
  20.    fg_setcolor(15);
  21.    fg_rect(0,319,0,199);
  22.    fg_setcolor(10);
  23.    fg_text("line one",8);
  24.    fg_locate(1,0);
  25.    fg_text("line two",8);
  26.    fg_waitkey();
  27.  
  28.    fg_setcolor(15);
  29.    fg_scroll(0,63,8,15,4,1);
  30.    fg_waitkey();
  31.    fg_scroll(0,63,12,19,-4,1);
  32.    fg_waitkey();
  33.  
  34.    fg_setmode(old_mode);
  35.    fg_reset();
  36. }
  37.